package com.cole.gx095.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import javax.persistence.*;
import java.sql.Timestamp;
import java.util.Objects;
@Data
@AllArgsConstructor
@NoArgsConstructor
@Entity
@EntityListeners(AuditingEntityListener.class)
@Table(name = "correlation")
public class Correlation {
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Id
    @Column(name = "id")
    private int id;

    @Column(name = "SaleContractId")
    private Integer saleContractId;
    @Column(name = "SaleContractNum")
    private String saleContractNum;
    @Column(name = "SaleBillId")
    private Integer saleBillId;
    @Column(name = "SaleBillNum")
    private String saleBillNum;

    @Column(name = "PurchanseContractId")
    private Integer purchanseContractId;
    @Column(name = "PurchanseContractNum")
    private String purchanseContractNum;
    @Column(name = "PurchanseBillId")
    private Integer purchanseBillId;
    @Column(name = "PurchanseBillNum")
    private String purchanseBillNum;

    @Column(name = "StockGoodsId")
    private Integer stockGoodsId;
    @Column(name = "TypeName")
    private String typeName;
    @Column(name = "Model")
    private String modle;
    @Column(name = "GoodsName")
    private String goodsName;
    @Column(name = "GoodsUintPrice")
    private Double goodsUnitPrice;
    /**
     * 关联数量
     */
    @Column(name = "CorrelationAccount")
    private Integer correlationAccount;
    /**
     * 关联金额
     */
    @Column(name = "CorrelationAmount")
    private Double correlationAmount;

    @Basic
    @Column(name = "CreateAdminTrueName")
    private String createAdminTrueName;
    @Basic
    @CreatedDate
    @Column(name = "CreateDate")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Timestamp createDate;
    /**
     * 0成本占用 1补票占用
     */
    @Basic
    @Column(name = "CorrelationType")
    private Integer correlationType;
    /**
     * 0正常 1作废
     */
    @Basic
    @Column(name = "Status")
    private Integer status;

}
